package com.flexandair
{
	import com.flexandair.controller.AddDesignCanvasCommand;
	import com.flexandair.controller.AssembleObjectsCommand;
	import com.flexandair.controller.StartupCommand;
	
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;


	public class ApplicationFacade extends Facade implements IFacade
	{
		public static const STARTUP:String = "STARTUP";
		public static const ADD_OBJECT_DESIGNER_CANVAS:String = "ADD_OBJECT_DESIGNER_CANVAS";
		public static const DATABASE_PROFILE_SELECTED:String ="DATABASE_PROFILE_SELECTED";
		public static const ASSEMBLE_OBJECTS:String = "ASSEMBLE_OBJECTS";

		public static function getInstance() : ApplicationFacade
		{
			if ( instance == null )
			{
				instance = new ApplicationFacade();
			}
			return instance as ApplicationFacade
		}
		
		override protected function initializeController() : void  
		{ 
			super.initializeController();    
			registerCommand( STARTUP,  StartupCommand); 
			registerCommand( ADD_OBJECT_DESIGNER_CANVAS, AddDesignCanvasCommand);
			registerCommand( ASSEMBLE_OBJECTS, AssembleObjectsCommand);
		}
		
		public function startUp ( application:CRUDdyBuddy ) : void
		{
			sendNotification( STARTUP, application );
		}
	}
}